<template>
	<view>
		<view class="content auto m-top40">
			<view @click="toUrl(`/answer/studyList?id=${infoData.classify_id}`)"> 
				<headline :title="infoData.classify_name" all></headline>
			</view>
		</view>
		<scroll-view scroll-x="true" class="rows nowrap scroll  m-top40">
			<view class="list boxshow wrap" v-for="(item,index) in infoData.goods" :key="item.goods_id"
				@click="toUrl(`/answer/play?goods_id=${item.goods_id}`);">
				<image :src="$imgUrls(item.img)" mode="aspectFill" class="listImg"></image>
				<view class="padding20-24 d-flex f-column ">
					<text class="ellipsis color_1A size36">{{item.name}}</text>
					<text class="rows color_AB h6 m-top50">{{item.start_time}}</text>
				</view>
			</view>

		</scroll-view>
	</view>
</template>

<script>
	import headline from '@/components/home/headline.vue'
	export default {
		name: "studies",
		props: ['pageData'],
		components:{
			headline
		},
		data() {
			return {
				infoData: '',
			};
		},
		mounted() {
			this.getBlockInfo();
		},
		methods: {
			async getBlockInfo() {
				const pageData = this.pageData;
				const result = await this.$getBlockInfo(pageData.list);
				if (!result.list.length || !result.list[0].goods.length) return;
				this.infoData = result.list[0];
			}

		},
	}
</script>

<style lang="scss" scoped>
	.content {
		width: 674rpx;
	}

	.scroll {
		height: 428rpx;
	}

	.list {
		width: 412rpx;
		height: 420rpx;
		display: inline-block;
		margin-left: 38rpx;
		border-radius: 10rpx;

	}

	.list:last-child {
		margin-right: 38rpx;
	}

	.listImg {
		width: 100%;
		height: 246rpx;
		border-radius: 10rpx;
	}
</style>